<template>
  <div class="sidebar-wrap">
    <VanSidebar v-bind="$attrs">
      <slot name="sidebar"></slot>
    </VanSidebar>
    <div class="sidebar-wrap__body">
      <slot></slot>
    </div>
  </div>
</template>

<script setup>
import { useFlexWrap } from "@/utils/appUtils.js";

useFlexWrap();
</script>

<style lang="scss" scoped>
.sidebar-wrap {
  height: 100%;
  flex: 1 1 0;
  display: flex;
  overflow: hidden;

  &__body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--dx-color-background);
  }
}
.van-sidebar {
  flex: none;
  overflow-y: auto;
  background-color: var(--dx-color-background-soft);
}
</style>
